import { takeEvery, put, call } from "redux-saga/effects";

const getListApi = () => {
  return fetch("http://121.89.205.189:3000/api/pro/list")
    .then((response) => response.json())
    .then((res) => {
      return res;
    });
};

function* fn3() {
  const res = yield call(getListApi);
  yield put({ type: "getList", list: res.data });
}
function* mySaga() {
  yield takeEvery("asyncGetList", fn3);
}

export default mySaga;
